import string
import random

# 1, 生成四位验证码，其中包含大写、小写或数字
source = string.ascii_lowercase + string.ascii_lowercase + string.digits
captcha = ''
for i in range(4):
    captcha += random.choice(source)
print(captcha)

captcha2 = ''.join(random.choices(source, k=4))
print(captcha2)

captcha3 = ''.join(random.sample(source, k=4))
print(captcha3)
